//app.js
const util = require('./utils/util.js')
import {
  tabExtendlist
} from './common/tabbar'
App({
  onLaunch: function () {
    const _this = this
    wx.getSystemInfo({
      success: function (res) {
        _this.globalData.statusHeight = res.statusBarHeight
        if (res.model.indexOf("iPhone X") !== -1) {
          console.log('is iphone x')
          _this.globalData.isIPhoneX = true
		  
		  
        }
      },
    })
  },
  getAuth(auth) {
    return tabExtendlist[auth]
  },
  isLogin() {
    const loginInfo = wx.getStorageSync('loginInfo')
    if (loginInfo.phoneNum) {
      return true
    } else {
      return false
    }
  },
  showToast(title) {
    wx.showToast({
      icon: 'none',
      title: title,
    })
  },
  getUtil: util,
  globalData: {
    statusHeight: '',
    version: 'V1.1.7', // 版本信息
    isIPhoneX: false, // 是否是iPhoneX
    modifyRecipient: null, // 修改的收件人信息
    deleteRecipientId: '', // 删除的收件人ID
    recipientItem: {}, //收件人信息
    senderItem: {}, //寄件人信息
    contactItem: {}, // 取票人信息
    deleteContactId: '', // 删除的取票人ID
    coupon: 0,
    deleteSenderId: '', // 删除的收件人ID
    farmerToken: '', //邀请人token
    fruit: '', // 品种信息（首页选择之后其他页面使用）
    type: '',
   tabbarlist:tabExtendlist.dispatch
  }
})